import Main from '@/view/main'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面不会缓存
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  {
    path: '/',
    name: 'root',
    redirect: '/home',
    component: Main,
    meta: {
      hideInMenu: true,
      notCache: true,
      title: '主页'
    },
    children: [
      {
        path: 'home',
        name: 'home',
        meta: {
          hideInMenu: true,
          notCache: true,
          title: '主页'
        },
        component: () => import('@/view/home.vue')
      }
    ]
  },
  {
    path: '/401',
    name: 'error_401',
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    component: () => import('@/view/error-page/404.vue')
  },
  {
    path: '/system',
    name: 'system',
    meta: {
      icon: 'gear-a',
      title: '系统管理'
    },
    component: Main,
    children: [
      {
        path: 'view',
        name: 'user_view',
        meta: {
          icon: 'person-stalker',
          title: '用户管理'
        },
        component: () => import('_v/system/user/index.vue')
      },
      {
        path: 'role',
        name: 'role_view',
        meta: {
          icon: 'ios-people',
          title: '角色管理'
        },
        component: () => import('_v/system/role/index.vue')
      },
      {
        path: 'module',
        name: 'module_view',
        meta: {
          icon: 'ios-photos-outline',
          title: '模块管理'
        },
        component: () => import('_v/system/module/index.vue')
      },
      {
        path: 'function',
        name: 'function_view',
        meta: {
          icon: 'ios-grid-view-outline',
          title: '功能管理'
        },
        component: () => import('_v/system/function/index.vue')
      }
    ]
  },
  {
    path: '/projects',
    name: 'projects',
    meta: {
      icon: 'stats-bars',
      title: '项目管理'
    },
    component: Main,
    children: [
      {
        path: 'projects',
        name: 'projects_view',
        meta: {
          title: '项目管理',
          icon: 'arrow-graph-up-right'
        },
        component: () => import('_v/projects/projects/index.vue')
      },
      {
        path: 'type',
        name: 'projects_type',
        meta: {
          title: '项目类型',
          icon: 'filing'
        },
        component: () => import('_v/projects/type/index.vue')
      }
    ]
  },
  {
    path: '/news',
    name: 'news',
    meta: {
      icon: 'social-hackernews',
      title: '新闻管理'
    },
    component: Main,
    children: [
      {
        path: 'news',
        name: 'news_view',
        meta: {
          title: '新闻管理',
          icon: 'social-buffer'
        },
        component: () => import('_v/news/news/index.vue')
      },
      {
        path: 'type',
        name: 'news_type',
        meta: {
          title: '新闻类型',
          icon: 'navicon-round'
        },
        component: () => import('_v/news/type/index.vue')
      }
    ]
  },
  {
    path: '/homeManage',
    name: 'homeManage',
    meta: {
      icon: 'home',
      title: '首页管理'
    },
    component: Main,
    children: [
      {
        path: 'article',
        name: 'homeManage_article',
        meta: {
          title: '文章管理',
          icon: 'document-text'
        },
        component: () => import('_v/home/article/index.vue')
      },
      {
        path: 'banner',
        name: 'homeManage_banner',
        meta: {
          title: '滚动图',
          icon: 'images'
        },
        component: () => import('_v/home/banner/index.vue')
      },
      {
        path: 'image',
        name: 'homeManage_image',
        meta: {
          title: '图片处理',
          icon: 'images'
        },
        component: () => import('_v/home/image/index.vue')
      }
    ]
  }
]
